package com.zzxx.mapper;

import com.zzxx.entity.ManagerPower;
import com.zzxx.entity.ManagerPowerExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface ManagerPowerMapper {
    @SelectProvider(type=ManagerPowerSqlProvider.class, method="countByExample")
    long countByExample(ManagerPowerExample example);

    @DeleteProvider(type=ManagerPowerSqlProvider.class, method="deleteByExample")
    int deleteByExample(ManagerPowerExample example);

    @Delete({
        "delete from managerpower",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String id);

    @Insert({
        "insert into managerpower (id, managerId, ",
        "powerType, powerId, ",
        "powerLevel)",
        "values (#{id,jdbcType=VARCHAR}, #{managerid,jdbcType=VARCHAR}, ",
        "#{powertype,jdbcType=INTEGER}, #{powerid,jdbcType=VARCHAR}, ",
        "#{powerlevel,jdbcType=INTEGER})"
    })
    int insert(ManagerPower row);

    @InsertProvider(type=ManagerPowerSqlProvider.class, method="insertSelective")
    int insertSelective(ManagerPower row);

    @SelectProvider(type=ManagerPowerSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="managerId", property="managerid", jdbcType=JdbcType.VARCHAR),
        @Result(column="powerType", property="powertype", jdbcType=JdbcType.INTEGER),
        @Result(column="powerId", property="powerid", jdbcType=JdbcType.VARCHAR),
        @Result(column="powerLevel", property="powerlevel", jdbcType=JdbcType.INTEGER)
    })
    List<ManagerPower> selectByExample(ManagerPowerExample example);

    @Select({
        "select",
        "id, managerId, powerType, powerId, powerLevel",
        "from managerpower",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.VARCHAR, id=true),
        @Result(column="managerId", property="managerid", jdbcType=JdbcType.VARCHAR),
        @Result(column="powerType", property="powertype", jdbcType=JdbcType.INTEGER),
        @Result(column="powerId", property="powerid", jdbcType=JdbcType.VARCHAR),
        @Result(column="powerLevel", property="powerlevel", jdbcType=JdbcType.INTEGER)
    })
    ManagerPower selectByPrimaryKey(String id);

    @UpdateProvider(type=ManagerPowerSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("row") ManagerPower row, @Param("example") ManagerPowerExample example);

    @UpdateProvider(type=ManagerPowerSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("row") ManagerPower row, @Param("example") ManagerPowerExample example);

    @UpdateProvider(type=ManagerPowerSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(ManagerPower row);

    @Update({
        "update managerpower",
        "set managerId = #{managerid,jdbcType=VARCHAR},",
          "powerType = #{powertype,jdbcType=INTEGER},",
          "powerId = #{powerid,jdbcType=VARCHAR},",
          "powerLevel = #{powerlevel,jdbcType=INTEGER}",
        "where id = #{id,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(ManagerPower row);
}